using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class MarketQuestionnaireMap : EntityTypeConfiguration<MarketQuestionnaire>
    {
        public MarketQuestionnaireMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.agegroup)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.infor)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.search)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.speed)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.other)
                .HasMaxLength(500);

            this.Property(t => t.website1)
                .HasMaxLength(100);

            this.Property(t => t.website2)
                .HasMaxLength(100);

            this.Property(t => t.website3)
                .HasMaxLength(100);

            this.Property(t => t.website4)
                .HasMaxLength(100);

            this.Property(t => t.website5)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("MarketQuestionnaire");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.agegroup).HasColumnName("agegroup");
            this.Property(t => t.infor).HasColumnName("infor");
            this.Property(t => t.search).HasColumnName("search");
            this.Property(t => t.speed).HasColumnName("speed");
            this.Property(t => t.talk).HasColumnName("talk");
            this.Property(t => t.video).HasColumnName("video");
            this.Property(t => t.online).HasColumnName("online");
            this.Property(t => t.subscribe).HasColumnName("subscribe");
            this.Property(t => t.other).HasColumnName("other");
            this.Property(t => t.website1).HasColumnName("website1");
            this.Property(t => t.website2).HasColumnName("website2");
            this.Property(t => t.website3).HasColumnName("website3");
            this.Property(t => t.website4).HasColumnName("website4");
            this.Property(t => t.website5).HasColumnName("website5");
        }
    }
}
